package common.net
{
    import flash.display.Bitmap;
    import flash.events.Event;
    import flash.events.IOErrorEvent;

    import org.granite.net.DisplayAssetLoader;

    public class ImageLoader extends DisplayAssetLoader
    {
        public function ImageLoader():void
        {
            super (3);
        }

        protected override function _loadCompleteHandler(e:Event):void
        {
            var bmp:Bitmap = _loader.content as Bitmap;
            if (bmp == null)
            {
                _loadIOErrorHandler (new IOErrorEvent (IOErrorEvent.IO_ERROR , false , false , 'this asset is not a bitmapData'));
            }
            else
            {
                _data = bmp.bitmapData;
                //stop();
                this.dispatchEvent (e);
            }
        }
    }
}
